package com.wms;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * @author wangqiang
 * @version 1.0
 * @description: TODO web容器中进行部署
 * @date 2021/9/24 15:25
 */
public class ConsumerServletInitializer extends SpringBootServletInitializer {


    /**
     *
     * jar包:执行SpringBootApplication的run方法,启动IOC容器,然后创建嵌入式Servlet容器
     * war包:  先是启动Servlet服务器,服务器启动Springboot应用(springBootServletInitizer),然后启动IOC容器
     *
     * 打war包:
     * 1: 在pom.xml依赖配置中修改 <packaging>war</packaging>
     * 2: 在idea顶部菜单栏目中点击Build再选择Build Artifacts产品类型就可以在项目的target目录下生成对应的war
     * 3: 或者 maven install
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
    {
        return application.sources(ConsumerApplication.class);
    }

}
